Ext.define('Seq.svg.Align', {
	        extend : 'Seq.svg.Base',

	        right : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (1 < selected.length) {
			        x2 = me.getBBox(selected[0]).x2;
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, x2 - bbox.x2, 0);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        left : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (1 < selected.length) {
			        x = me.getBBox(selected[0]).x;
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, x - bbox.x, 0);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        top : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (1 < selected.length) {
			        y = me.getBBox(selected[0]).y;
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, 0, y - bbox.y);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        bottom : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (1 < selected.length) {
			        y2 = me.getBBox(selected[0]).y2;
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, 0, y2 - bbox.y2);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        centerV : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (1 < selected.length) {
			        cx = me.getBBox(selected[0]).cx;
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, cx - bbox.cx, 0);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        centerH : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (1 < selected.length) {
			        cy = me.getBBox(selected[0]).cy;
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, 0, cy - bbox.cy);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        equalV : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (2 < selected.length) {
			        var minCy = 99999, maxCy = -99999, dis;
			        for (var i = 0, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        minCy = Math.min(minCy, bbox.cy);
				        maxCy = Math.max(maxCy, bbox.cy);
			        }
			        var dis = (maxCy - minCy) / (selected.length - 1);
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, 0, minCy + i * dis - bbox.cy);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        },

	        equalH : function() {
		        var me = this, selectBox = me.canvas.selectBox, selected = selectBox.selected, subBoxs = selectBox.subBoxs;
		        if (2 < selected.length) {
			        var minCx = 99999, maxCx = -99999, dis;
			        for (var i = 0, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        minCx = Math.min(minCx, bbox.cx);
				        maxCx = Math.max(maxCx, bbox.cx);
			        }
			        var dis = (maxCx - minCx) / (selected.length - 1);
			        for (var i = 1, len = selected.length; i < len; i++) {
				        var item = selected[i], bbox = me.getBBox(item);
				        var m = new Snap.Matrix(1, 0, 0, 1, minCx + i * dis - bbox.cx, 0);
				        item.transform(item.transform().localMatrix.add(m));
				        subBoxs[i].transform(subBoxs[i].transform().localMatrix.add(m));
			        }
		        }
	        }

        });